# -*- coding: utf-8 -*-

# File Name : internel_truck_number
# Description :
# Author : marje
# date : 2022/6/9
# Change Activity : 2022/6/9
import os
import ml
import requests

ip = '127.0.0.1'


# ip = '10.21.18.118'


def main():
    paths = ml.list_file_paths_in_dir(r'C:\Users\marje\Desktop\nantong\外集卡车号', suffix='.jpg')
    for p in paths:
        # p = 'D:/image/道口箱号识别/success/MSKU_842043_2__True____24a14b2c565e48a48f3c021d2509f0eb.jpg'
        _, name = os.path.split(p)
        file = {'pic': open(p, 'rb')}
        res = requests.post(url=rf'http://{ip}:8080/ocr/external_truck_number', files=file)


if __name__ == '__main__':
    main()
